package com.ssm.controller;




import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.support.RequestContext;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.jstl.sql.Result;

import java.util.List;

/**
 * Created by Lenovo on 2019-4-21.
 */
@Controller
@RequestMapping("/Student")
public class StudentController {
    @RequestMapping(value="/index")
        public String  test(HttpServletRequest request, Model model){
             return "index";
        }
@RequestMapping("list.do")
    public String list(){

        return "listStudents";
}
    @RequestMapping(value = "toAdd.do",method = RequestMethod.POST)
    public String toAdd(){
          return "addStudent";
    }
    @RequestMapping(value = "add.do",method = RequestMethod.POST)
    public String add(@RequestParam("username") String name, @RequestParam("pwd") String password){
        System.out.println(name);
        System.out.println(password);
        return "listStudents";
    }
}
